﻿using System.Collections.Generic;
using Assets.Scripts.Net.Data.Model;

namespace Assets.Scripts.Net.Data.Reader
{
    public class ExamInfoReader:NetInfoReaderBase
    {
        public ExamInfoReader(Dictionary<string, object> dict) : base(dict)
        {
            if(dict==null)return;
            ExamInfo info = new ExamInfo();
            AutoSetValue<ExamInfo>(dict, info);
            AddInfoToFactory<ExamInfo>(info);
            if (dict.ContainsKey("quedata"))//问题数据
            {
                List<object> list = dict["quedata"] as List<object>;
                NetReaderFactory.Instance().ReaderInfo(ReaderInfoType.QueInfo, null, list);
            }
            if (dict.ContainsKey("ansdata"))//答案数据
            {
                List<object> list = dict["ansdata"] as List<object>;
                NetReaderFactory.Instance().ReaderInfo(ReaderInfoType.AnsInfo, null, list);              
            }
        }
    }
}